package cn.iocoder.an.module.business.dal.mysql.equipmentkeepsetting;

import java.util.*;

import cn.iocoder.an.framework.common.pojo.PageResult;
import cn.iocoder.an.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.an.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.an.module.business.dal.dataobject.equipmentkeepsetting.EquipmentKeepSettingDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.an.module.business.controller.admin.equipmentkeepsetting.vo.*;
import org.springframework.stereotype.Repository;

/**
 * 保养项设置 Mapper
 *
 * @author zzy
 */
@Mapper
@Repository("EquipmentKeepSettingMapper")
public interface EquipmentKeepSettingMapper extends BaseMapperX<EquipmentKeepSettingDO> {

    default PageResult<EquipmentKeepSettingDO> selectPage(EquipmentKeepSettingPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<EquipmentKeepSettingDO>()
                .eqIfPresent(EquipmentKeepSettingDO::getKeepType, reqVO.getKeepType())
                .likeIfPresent(EquipmentKeepSettingDO::getName, reqVO.getName())
                .eqIfPresent(EquipmentKeepSettingDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(EquipmentKeepSettingDO::getCreateTime, reqVO.getCreateTime())
                .inIfPresent(EquipmentKeepSettingDO::getId, reqVO.getIds())
                .orderByDesc(EquipmentKeepSettingDO::getId));
    }

    default PageResult<EquipmentKeepSettingDO> selectPageNew(EquipmentKeepSettingPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<EquipmentKeepSettingDO>()
                .eq(EquipmentKeepSettingDO::getStatus, 1)
                .in(EquipmentKeepSettingDO::getId, reqVO.getIds())
                .orderByDesc(EquipmentKeepSettingDO::getId));
    }


}